// -----------------------------
// Author: 		Dhaenens Gert	
// Creation: 	1/6/2015 1:34:13 AM				
// -----------------------------

#include "LFOFilter.h"

#include "Oscillator.h"


LFOFilter::LFOFilter(SoundWaveType type)
: m_lpOscillator(Oscillator::Create(type))
{
}

LFOFilter::~LFOFilter()
{
	delete m_lpOscillator;
}

void LFOFilter::Apply(Float leftChannelIn, Float rightChannelIn, Float t, Float* lpLeftChannelOut, Float* lpRightChannelOut) const
{
	m_lpOscillator->Frequency = Frequency;
	m_lpOscillator->Harmonics = Harmonics;
	m_lpOscillator->Amplitude = Amplitude;
	Float offset = m_lpOscillator->Sample(t);
	
	(*lpLeftChannelOut) = leftChannelIn + (Strength * offset);
	(*lpRightChannelOut) = rightChannelIn + (Strength * offset);
}
void LFOFilter::Reset()
{

}